package com.decent.manager.system.service.impl;

import com.decent.common.bo.MessageBean;
import com.decent.manager.system.dao.SystemOrderDao;
import com.decent.manager.system.dto.SystemOrderDTO;
import com.decent.manager.system.service.SystemOrderService;
import com.decent.manager.system.vo.SystemOrderVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: decent Gjh
 * @date: 2022/11/02/9:33
 * @description:
 */
@Service
@Slf4j
public class SystemOrderServiceImpl implements SystemOrderService {
    private final SystemOrderDao orderDao;

    public SystemOrderServiceImpl(SystemOrderDao orderDao) {
        this.orderDao = orderDao;
    }

    @Override
    public MessageBean selectOrderList(SystemOrderDTO orderDTO) {
        //获取列表
        List<SystemOrderVO> orderList = orderDao.selectOrderList(orderDTO);
        if (orderList == null || orderList.isEmpty()) {
            return MessageBean.fail("暂无订单");
        }
        return MessageBean.success(orderList);
    }
}
